﻿using System;
using System.ComponentModel;
using System.Windows;
using System.Windows.Shapes;
using SpectrumAnalyser.ModelObjects;
using SpectrumAnalyser.ModelObjects.Interfaces;

namespace SpectrumAnalyser.Controls.Wpf.ViewModels
{
    [Serializable]
    public class SpectrumDataPointViewModel : DependencyObject, INotifyPropertyChanged, IDataPoint
    {
        public SpectrumDataPointViewModel()
        {

        }

        public SpectrumDataPointViewModel(double x, double y)
        {
            ViewPoint = new Point(x, y);
        }

        public Point ViewPoint { get; set; }

        public SpectrumPoint SpectrumPoint { get; set; }
        public string HiddenLabelText { get; set; }

        public string LabelText { get; set; }

        public new bool IsVisible { get; set; }

        public bool IsChecked { get; set; }

        public Shape DataPointGeometry
        {
            get
            {
                return string.IsNullOrEmpty(LabelText)
                           ? new Ellipse()
                           : new Ellipse {Width = 10, Height = 10};
            }
        }

        #region Implementation of INotifyPropertyChanged

        public event PropertyChangedEventHandler PropertyChanged;

        #endregion
    }
}